﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VoteStatistics.aspx.cs"
    Inherits="Meeting.Web.Admin.MeetingAfter.VoteStatistics" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>投票统计</title>
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="../../Css/main.css" />
    <script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script type="text/javascript">

        $(function () {
            //初始化列表
            $('#mainList').datagrid({
                url: 'VoteStatisticsOperation.ashx?method=GetMeetingVote',
                singleSelect: true,
                pagination: true, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: 20, //默认一页数据条数
                collapsible: false
            });
            //设置分页
            var p = $("#mainList").datagrid("getPager");
            $(p).pagination({
                pageSize: 20, //每页显示的记录条数，默认为10   
                pageList: [10, 20, 30], //可以设置每页记录条数的列表   
                beforePageText: '第', //页数文本框前显示的汉字   
                afterPageText: '页    共 {pages} 页',
                displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
            });
        });
        //
        function DoSearch() {
            $('#mainList').datagrid('reload', {
                Name: $("#fName").val(),
                Begin: $("#txtBeginTime").val(),
                End: $("#txtEndTime").val()
            });
        } 
    </script>
    <style type="text/css">
        input
        {
            height: 18px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table class="SearchTable">
        <tr>
            <td>
                投票主题:
            </td>
            <td>
                <input id="fName" style="width: 120px;" class="easyui-validatebox" />
            </td>
            <td>
                发起时间:
            </td>
            <td>
                <input id="txtBeginTime" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                    style="width: 120px" />
            </td>
            <td>
                ~
            </td>
            <td>
                <input id="txtEndTime" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                    style="width: 120px" />
            </td>
            <td>
                <a href="#" class="easyui-linkbutton" onclick="DoSearch();">查询</a>
            </td>
        </tr>
    </table>
    <table id="mainList" class="easyui-datagrid" style="width: 1120px;">
        <thead>
            <tr>
                <th data-options="field:'Id',width:120,hidden:true">
                </th>
                <th data-options="field:'MeetingId',width:120,hidden:true">
                </th>

                <th data-options="field:'MeetingName',width:140">
                    所属会议
                </th>
                <th data-options="field:'Theme',width:260">
                    投票主题
                </th>
                 <th data-options="field:'Category',width:120,formatter:formatCategory">
                        投票类型
                    </th>
                <th data-options="field:'StartDate',width:100">
                    投票时间
                </th>
                <th data-options="field:'EndDate',width:100 ">
                    结束时间
                </th>
                <th data-options="field:'actionColumn',width:120,formatter:formatResult">
                    结果
                </th>
            </tr>
        </thead>
    </table>
      <script type="text/javascript">
          function formatCategory(val, row) {
              if (val == 1) {
                  return "单选";
              } else if (val == 2) {
                  return "多选";
              } else if (val == 3) {
                  return "打分";
              } else if (val == 4) {
                  return "分局打分";
              }
              return "";
          }
            
       
        function formatResult(val, row) {
            return "<a  href='#' onclick=\"MeetingVoteResult('" + row.Id + "','" + row.MeetingId + "','" + row.Category + "');\" >查看结果</a>";
        }
        function OpenEdit(inUrl, param, width, height) {
            var wName;
             var radStr = Math.random();
            var url = inUrl + '?Radstr=' + radStr + param;
            art.dialog.open(url, {
                id: 'AAAj', title: '投票结果', width: width, height: height, lock: true, ok: function () { },
                close: function () {
                    //                        var id = art.dialog.data('id'); // 读取人员选择返回值
                    //                        var name = art.dialog.data('name');
                    //                        $("#HostId").val(id);
                    //                        $("#Host").val(name);
                }
            }, true);
        }


        function MeetingVoteResult(id, meetingId, category) {
            OpenEdit("VoteResult.aspx", "&Id=" + id + "&MeetingId=" + meetingId+"&Category="+category, 630, 350);
        }
    </script>
    </form>
</body>
</html>
